home *** CD-ROM | disk | FTP | other *** search
-
- package sub_arctic.test;
-
- /* import various pieces of the sub_arctic toolkit that we need */
- import sub_arctic.lib.*;
- import sub_arctic.input.*;
- import sub_arctic.constraints.std_function;
- import sub_arctic.constraints.std_constraint_consts;
-
- public class panner_test extends debug_interactor_applet
- implements callback_object {
-
- /* need to reference this in the callback */
- panner mypanner;
- /* initialization of sub_arctic interface when applet starts */
- public void build_ui(base_parent_interactor top)
- {
- button b;
- row r;
- column c;
- int_label l;
-
- l = new int_label();
- l.set_pos(10,0);
- l.set_part_a_constraint(std_function.eq(NEXT_SIBLING.PART_A()));
- top.add_child(l);
-
- c = new column(30, column.CENTER_JUSTIFIED);
- for (int i = 0; i<5; i++)
- {
- r = new row(30, row.CENTER_JUSTIFIED);
- for (int j = 0; j<5; j++)
- {
- b = new button("PANNER TEST", this);
- r.add_child(b);
- }
- c.add_child(r);
- }
-
- mypanner = new panner(c);
- mypanner.set_y_constraint(std_function.eq(PREV_SIBLING.Y2()));
- mypanner.set_w_constraint(std_function.eq(PARENT.W()));
- mypanner.set_h_constraint(std_function.
- subtract(PARENT.H(), PREV_SIBLING.H(), 0));
- top.add_child(mypanner);
-
- l = new int_label();
- l.set_pos(50,0);
- l.set_part_a_constraint(std_function.eq(PREV_SIBLING.PART_B()));
- top.add_child(l);
-
-
- // l = new int_label();
- // l.set_pos(10,0);
- // l.set_part_a_constraint(std_function.eq(NEXT_SIBLING.PART_A()));
- // top.add_child(l);
- //
- // parent_with_parts pwp = new parent_with_parts();
- // pwp.set_y_constraint(std_function.eq(PREV_SIBLING.Y2()));
- // pwp.set_w_constraint(std_function.eq(FIRST_CHILD.W()));
- // pwp.set_h_constraint(std_function.eq(FIRST_CHILD.H()));
- // pwp.set_part_a_constraint(std_function.eq(FIRST_CHILD.PART_A()));
- // top.add_child(pwp);
- //
- // h_scrollbar sb = new h_scrollbar(0,0,200,this);
- // pwp.add_child(sb);
- //
- }
-
- /* handle callback from the button. */
- public void callback(interactor from, event evt, int cb_num, Object cb_parm)
- {
- /* reset to zero if they push any button */
- mypanner.set_x_view_coordinate(0);
- mypanner.set_y_view_coordinate(0);
- }
- };
-
- /*=========================== COPYRIGHT NOTICE ===========================
-
- This file is part of the subArctic user interface toolkit.
-
- Copyright (c) 1996 Scott Hudson and Ian Smith
- All rights reserved.
-
- The subArctic system is freely available for most uses under the terms
- and conditions described in
- http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html
- and appearing in full in the lib/interactor.java source file.
-
- The current release and additional information about this software can be
- found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/
-
- ========================================================================*/
-